//
//  BSKClassifyTableViewCell.m
//  MicroMemory
//
//  Created by rimi on 16/7/15.
//  Copyright © 2016年 BlueSky. All rights reserved.
//

#import "BSKClassifyTableViewCell.h"
#import "UIView+SDAutoLayout.h"

@implementation BSKClassifyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self loadUI];
    }
    return self;
}
- (void)loadUI {
    UIView *backView = [[UIView alloc] init];
    self.keyImageView = [[UIImageView alloc] init];
    self.titleLabel = [[UILabel alloc] init];
    UIImageView *imageView = [[UIImageView alloc] init];
    UIImageView *deleteImageView = [[UIImageView alloc] init];
    [backView addSubview:self.keyImageView];
    [backView addSubview:self.titleLabel];
    [backView addSubview:imageView];
    [self addSubview:backView];
    [self addSubview:deleteImageView];
    
    backView.sd_layout.topSpaceToView(self, 10)
    .leftSpaceToView(self, 10)
    .bottomSpaceToView(self, 0)
    .rightSpaceToView(self, 10);
    backView.backgroundColor = [UIColor whiteColor];
    
    imageView.sd_layout.centerYEqualToView(backView)
    .rightSpaceToView(backView, 10)
    .widthIs(20)
    .heightIs(20);
//    imageView.backgroundColor = [UIColor grayColor];
    imageView.image = [UIImage imageNamed:@"right^"];
    
    self.keyImageView.sd_layout.centerYEqualToView(backView)
    .leftSpaceToView(backView, 10)
    .widthIs(25)
    .heightIs(25);
    self.keyImageView.image = [UIImage imageNamed:@"keyGray"];
    
    self.titleLabel.sd_layout.topSpaceToView(backView, 5)
    .leftSpaceToView(self.keyImageView, 10)
    .bottomSpaceToView(backView, 5)
    .rightSpaceToView(imageView, 10);
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    
    deleteImageView.sd_layout.centerYEqualToView(backView)
    .rightSpaceToView(self, -30)
    .heightIs(30)
    .widthIs(30);
    //    imageView.backgroundColor = [UIColor grayColor];
    deleteImageView.image = [UIImage imageNamed:@"delete"];
}
@end
